#ifndef IMAGEPREVIEWAREA_H
#define IMAGEPREVIEWAREA_H

#include <QImage>
#include <QLabel>
#include <QPainter>
#include <QRect>
#include <QScrollArea>
#include <QtWidgets>

class ImagePreviewArea : public QScrollArea
{
    Q_OBJECT

public:
    explicit ImagePreviewArea(QWidget *parent = nullptr);

    bool load(const QImage &image);
    bool load(const QString &filePath);

    const QImage &getOriginalImage() const;
    void          clear();

private:
    void updateDisplay();

    QImage  image;
    QLabel *imageLabel;
};

#endif // IMAGEPREVIEWAREA_H
